﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true"
    CodeFile="SetValue.aspx.cs" Inherits="admin_Settings_SetValue" %>

<%@ Register TagName="TabMenu" TagPrefix="menu" Src="~/admin/Setting/Menu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $(".addNew").colorbox({ width: "500px", inline: true, href: "#frmAddNew" });

        });

        function closeOverlay() {
            $.colorbox.close();
        }
    </script>
    <div style="display: none">
        <div id="frmAddNew" class="overlaypanel">
            <h2>
                Thêm</h2>
            <ul class="fl">
                <li>
                    <label>
                        Tên
                    </label>
                    <br />
                    <asp:TextBox runat="Server" ID="txtSettingName" Width="200" />
                    <asp:CustomValidator runat="Server" ID="valExist" ValidationGroup="new" ControlToValidate="txtSettingName"
                        ErrorMessage="Menu đã tồn tại" Display="dynamic" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="Server" ValidationGroup="new"
                        ControlToValidate="txtSettingName" ErrorMessage="Nhập tên" Display="Dynamic" />
                </li>
                <li>
                    <label>
                        Giá trị
                    </label>
                    <br />
                    <asp:TextBox runat="Server" ID="txtSettingValue" Width="200" />
                    <asp:CustomValidator runat="Server" ID="CustomValidator1" ValidationGroup="new" ControlToValidate="txtSettingValue"
                        ErrorMessage="Menu đã tồn tại" Display="dynamic" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="Server" ValidationGroup="new"
                        ControlToValidate="txtSettingValue" ErrorMessage="Nhập giá trị" Display="Dynamic" />
                </li>
            </ul>
            <asp:Button runat="server" ID="btnAdd" ValidationGroup="new" CssClass="btn primary"
                OnClientClick="colorboxDialogSubmitClicked('new', 'frmAddNew');" Text="Thêm mới"
                OnClick="btnAdd_Click" />
            hoặc <a href="#" onclick="closeOverlay();">Hủy</a>
        </div>
    </div>
    <div class="content-box-outer">
        <div class="content-box-right">
            <menu:TabMenu ID="menu1" runat="server" />
        </div>
        <div class="content-box-left">
            <h1>
                Cài đặt thông tin website <a href="#" class="addNew">Thêm</a>
            </h1>
            <div class="info">
                Cài đặt website
            </div>
            <asp:GridView runat="server" ID="grid" CssClass="beTable" BorderStyle="Solid" RowStyle-BorderWidth="0"
                RowStyle-BorderStyle="None" GridLines="None" Width="100%" AlternatingRowStyle-BackColor="#f8f8f8"
                AlternatingRowStyle-BorderColor="#f8f8f8" HeaderStyle-BackColor="#F1F1F1" CellPadding="3"
                AutoGenerateColumns="False" AutoGenerateEditButton="true" AutoGenerateDeleteButton="true" DataKeyNames="Name"
                AllowPaging="true" AllowSorting="true">
                <AlternatingRowStyle BackColor="#F8F8F8" BorderColor="#F8F8F8"></AlternatingRowStyle>
                <Columns>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Tên">
                        <ItemTemplate>
                            <%# Eval("Name") %>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Giá trị" ItemStyle-Width="100%">
                        <ItemTemplate>
                            <%# Eval("Value") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtSettingValue" Text='<%# Eval("Value") %>'
                                Width="500" />
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle BackColor="#F1F1F1"></HeaderStyle>
                <RowStyle BorderWidth="0px" BorderStyle="None"></RowStyle>
            </asp:GridView>
        </div>
    </div>

</asp:Content>
